#pragma once

#include "EndGameDbCommon.h"

namespace EndGameDB
{
	// 32-bit version
	void BitBoardToIndex(BitBoard *p, int64 *index);
	void IndexToBitBoard(int64 index, BitBoard *p, int wm, int wk, int bm, int bk, int maxwm,  int maxbm);

	// 64-bit version
	//void BitBoardToIndex64(BitBoard64 *p, int64 *index);
	//void IndexToBitBoard64(int64 index, BitBoard64 *p, int wm, int wk, int bm, int bk, int wmrank,  int bmrank);

	// template bitboard switching
	template<typename BB> void BitBoardToIndexXX(BB* p, int64* index);
	template<> void BitBoardToIndexXX<BitBoard>(BitBoard* p, int64* index);
	template<> void BitBoardToIndexXX<BitBoard64>(BitBoard64* p, int64* index);

	template<typename BB> void IndexToBitBoardXX(int64 index, BB *p, 
												int wm, int wk, int bm, int bk, int wmrank,  int bmrank);
	template<> void IndexToBitBoardXX<BitBoard>(int64 index, BitBoard *p, 
												int wm, int wk, int bm, int bk, int wmrank,  int bmrank);
	template<> void IndexToBitBoardXX<BitBoard64>(int64 index, BitBoard64 *p, 
												int wm, int wk, int bm, int bk, int wmrank,  int bmrank);
}
